//
//  AppDeviceDefine.h
//  WeiDianGuanJia
//
//  Created by 谢英泽 on 2017/5/7.
//  Copyright © 2017年 谢英泽. All rights reserved.
//

#ifndef AppDeviceDefine_h
#define AppDeviceDefine_h

#pragma mark - ************************设备相关************************
/**
 当前窗口
 */
#define kUI_Window          [UIApplication sharedApplication].keyWindow

/**
 判断手机型号
 */
#define kUI_is_IphoneX       ([[UIScreen mainScreen] bounds].size.height >= 812.0f )
#define kUI_is_Iphone6p      ([[UIScreen mainScreen] bounds].size.height == 736.0f )
#define kUI_is_Iphone6       ([[UIScreen mainScreen] bounds].size.height == 667.0f )
#define kUI_is_Iphone5       ([[UIScreen mainScreen] bounds].size.height == 568.0f )
#define kUI_is_Iphone4       ([[UIScreen mainScreen] bounds].size.height == 480.0f )

/**
 判断系统版本
 */
#define kUI_is_IOS10        ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0f)
#define kUI_is_IOS9          ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0f)
#define kUI_is_IOS8          ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0f)
#define kUI_is_IOS7          ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f && [[[UIDevice currentDevice systemVersion] floatValue] <= 7.2f)

#pragma mark - ************************存储密码业务相关************************
/**
 keychain数据
 */
#define kAPP_deviceUUID                @"deviceUUID"

#pragma mark - ************************DEBUG模式************************
/**
 DEBUG模式
 */
//#ifdef DEBUG
//#define DeBugLog(fmt,...) NSLog((@"\n\n[行号]%d\n" "[函数名]%s\n" "[日志]"fmt"\n"),__LINE__,__FUNCTION__,##__VA_ARGS__);
//#else
//#define DeBugLog(...)
//#endif

//#ifdef DEBUG
//#define NSLog(fmt,...) NSLog((@"\n\n[行号]%d\n" "[函数名]%s\n" "[日志]"fmt"\n"),__LINE__,__FUNCTION__,##__VA_ARGS__);
//#else
//#define NSLog(...)
//#endif

#ifdef DEBUG
#define NSLog(fmt,...) printf(("[%s] %s [Line %d] %s\n"),[[NSString dateStringWithDate:[NSDate date] AndDateFormatter:@"yyyy-MM-dd HH:mm:ss" isConversionTimeZone:NO] UTF8String],__PRETTY_FUNCTION__,__LINE__,[[NSString stringWithFormat:fmt,##__VA_ARGS__] UTF8String])
#else
#define NSLog(...)
#endif


/**
 弱引用
 */
#define WeakSelf            __weak typeof (self) weakself = self;
#define WeakObj(o)          __weak typeof(o) o##Weak = o;

/**
 RAC
 */
#define weakifyself            @weakify(self)
#define strongifyself          @strongify(self)

#endif /* AppDeviceDefine_h */
